package com.example.demo.business.dao;

import com.example.demo.business.bean.entity.HVideo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface HVideoDao extends JpaRepository<HVideo,Integer> {
    Page<HVideo> findBySearchStrLike(String searchKey, Pageable pageable);
    Page<HVideo> findByStarsLike(String starId,Pageable pageable);
    //通过类型和标签查找 通过更新时间排序
    Page<HVideo> findByTypeAndLabelIdsLikeOrderByCreatedAtDesc(int type,String labelIds,Pageable pageable);
    //通过类型和标签查找 通过热度排序
    Page<HVideo> findByTypeAndLabelIdsLikeOrderByHotDesc(int type,String labelIds,Pageable pageable);
    //通过类型查找所有 通过更新时间排序
    Page<HVideo> findByTypeOrderByCreatedAtDesc(int type,Pageable pageable);
    //查找VIP和类型查找 通过更新时间排序
    Page<HVideo> findByTypeAndVipOrderByCreatedAtDesc(int type,int isVip,Pageable pageable);
    //通过类型查找 通过热度排序
    Page<HVideo> findByTypeOrderByHotDesc(int type,Pageable pageable);
}
